package com.example.my.agiftthat.ui.home.fragment;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import java.util.List;

/**
 * Created by My on 2016/12/20.
 */

public class TabHomeAdapter extends FragmentPagerAdapter {
    private List<Fragment> mList;
    private String[] mArrHomeTitles;

    public TabHomeAdapter(FragmentManager fm, List<Fragment> mList, String[] mArrHomeTitles) {
        super(fm);
        this.mList = mList;
        this.mArrHomeTitles = mArrHomeTitles;
    }

    @Override
    public Fragment getItem(int position) {
        return mList.get(position);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mArrHomeTitles[position];
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
    }
}
